package com.googlecode.jmicroerp.wicket.administrare;

import com.googlecode.jmicroerp.model.NCategorie;
import com.googlecode.jmicroerp.wicket.DefaultPageTemplate;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButton;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButtons;
import com.googlecode.jmicroerp.wicket.components.grid.ColumnModel;
import com.googlecode.jmicroerp.wicket.components.grid.DefaultGridAction;
import com.googlecode.jmicroerp.wicket.components.grid.Grid;
import com.googlecode.jmicroerp.wicket.components.grid.PageParameters;
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.spring.injection.annot.SpringBean;

/**
 *
 * @author Alexandru.Codescu
 */
public class VizualizareCategoriiPage extends DefaultPageTemplate {
    @SpringBean(name = "defaultGridAction")
    private DefaultGridAction<NCategorie> gridAction;
    
    public VizualizareCategoriiPage() {
        ColumnModel[] grids = {
            new ColumnModel("Cod", "cod", String.class),
            new ColumnModel("Cod culoare", "codCuloare", String.class),
            new ColumnModel("Denumire", "denumire", String.class)
        };
        List<ColumnModel> columns = Arrays.asList(grids);
        ActionButton actionButton = new ActionButton(new PageParameters(EditareCategoriiPage.class));
        ActionButtons actionButtons = new ActionButtons(actionButton);
        Grid<NCategorie> dataGridConsum = new Grid<NCategorie>("grid", columns, NCategorie.class, gridAction, actionButtons);
        add(dataGridConsum);
    }
}
